package com.zilue.controller;

import com.zilue.balance.domain.BaseOrderInfo;
import com.zilue.balance.returnresult.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * Created by ZD on 2017/5/25.
 */
@RestController
@RequestMapping("/balance")
public class BalancePayController {
    @RequestMapping("/pay")
    public Result<BaseOrderInfo> pay(@RequestParam("accountId") String accountId, @RequestParam("corpId") Long corpId, @RequestParam("fee") Long fee,
                                     @RequestParam("orderNo") String orderNo, @RequestParam("source") Integer source, @RequestParam(value = "terminalId", required = false) String terminalId,
                                     @RequestParam(value = "operId", required = false) String operId) {
        BaseOrderInfo orderInfo = BaseOrderInfo.builder().logNo(UUID.randomUUID().toString()).build();
        return Result.createSuccessResult(orderInfo);
    }

    @RequestMapping("/refund")
    public Result<BaseOrderInfo> refund(@RequestParam("logNo") String logNo, @RequestParam("corpId") Long corpId, @RequestParam("fee") Long fee,
                                        @RequestParam("source") Integer source, @RequestParam(value = "terminalId", required = false) String terminalId,
                                        @RequestParam(value = "operId", required = false) String operId) {
        BaseOrderInfo orderInfo = BaseOrderInfo.builder().logNo(UUID.randomUUID().toString()).build();
        return Result.createSuccessResult(orderInfo);
    }

    @RequestMapping("/flushes")
    public Result<BaseOrderInfo> flushes(@RequestParam("logNo") String logNo, @RequestParam("corpId") Long corpId, @RequestParam("source") Integer source,
                                         @RequestParam(value = "terminalId", required = false) String terminalId, @RequestParam(value = "operId", required = false) String operId) {
        BaseOrderInfo orderInfo = BaseOrderInfo.builder().logNo(UUID.randomUUID().toString()).build();
        return Result.createSuccessResult(orderInfo);
    }

}
